<html>
<head><meta charset="utf-8"><title>printing a type · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/printing.20a.20type.html">printing a type</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210193656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/printing%20a%20type/near/210193656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/printing.20a.20type.html#210193656">(Sep 15 2020 at 21:32)</a>:</h4>
<p>if I have a ty, what is the best way to print that type for a diagnostic?</p>



<a name="210193722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/printing%20a%20type/near/210193722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/printing.20a.20type.html#210193722">(Sep 15 2020 at 21:33)</a>:</h4>
<p>I wouldn't print the whole type unless you need it for a suggestion, use a span instead</p>



<a name="210193754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/printing%20a%20type/near/210193754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/printing.20a.20type.html#210193754">(Sep 15 2020 at 21:33)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/struct.Diagnostic.html#method.span_note">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/struct.Diagnostic.html#method.span_note</a></p>



<a name="210193863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/printing%20a%20type/near/210193863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gus Wynn <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/printing.20a.20type.html#210193863">(Sep 15 2020 at 21:34)</a>:</h4>
<p>ah okay, ill try that!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>